<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Vue</title>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
</head>
<body>

<div id="app_jb" style="background: green">
    <runoobb></runoobb>
</div>
<div id="app_jb1" style="background: red">
    <runoobb></runoobb>
</div>

<script>
    let child = {
        template: '<h2>自定义组件！！！！</h2>'
    }
    let v = new Vue({
        el: '#app_jb',
        data: {
        },
        // <runoobb> 将只在父模板可用
        components: {
            'runoobb': child
        }
    });

    let a = new Vue({
        el: '#app_jb1',
        data: {

        }
    })
</script>

</body>
</html>